class Solution {
public:
    int duplicateNumbersXOR(vector<int>& nums) {
        long long bitmap = 0;
        int ret = 0;
        for(auto i : nums){
            if(bitmap >> i & 1)
            {
                //
                ret ^= i;
            }else{
                bitmap += ((long long)1<<i);
            }
        }
        return ret;
    }
};